import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SkPriceLogVO, SkPriceLogForm, SkPriceLogQuery } from '@/api/app/SkPriceLog/types';

/**
 * 查询用户金额日志列表
 * @param query
 * @returns {*}
 */

export const listSkPriceLog = (query?: SkPriceLogQuery): AxiosPromise<SkPriceLogVO[]> => {
  return request({
    url: '/app/SkPriceLog/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询用户金额日志详细
 * @param id
 */
export const getSkPriceLog = (id: string | number): AxiosPromise<SkPriceLogVO> => {
  return request({
    url: '/app/SkPriceLog/' + id,
    method: 'get'
  });
};

/**
 * 新增用户金额日志
 * @param data
 */
export const addSkPriceLog = (data: SkPriceLogForm) => {
  return request({
    url: '/app/SkPriceLog',
    method: 'post',
    data: data
  });
};

/**
 * 修改用户金额日志
 * @param data
 */
export const updateSkPriceLog = (data: SkPriceLogForm) => {
  return request({
    url: '/app/SkPriceLog',
    method: 'put',
    data: data
  });
};

/**
 * 删除用户金额日志
 * @param id
 */
export const delSkPriceLog = (id: string | number | Array<string | number>) => {
  return request({
    url: '/app/SkPriceLog/' + id,
    method: 'delete'
  });
};
